package com.lanchetech.dao;

import com.lanchetech.bean.request.BlogGoodsPageReq;
import com.lanchetech.entity.BlogGoods;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface BlogGoodsMapper {
    int deleteByPrimaryKey(Long id);

    int insert(BlogGoods record);

    int insertSelective(BlogGoods record);

    BlogGoods selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(BlogGoods record);

    int updateByPrimaryKey(BlogGoods record);

    List<BlogGoods> findAllByUserId(@Param("userId") Long userId);

    BlogGoods findOneByBlogIdAndUserId(@Param("blogId") Long blogId, @Param("userId") Long userId);

    int deleteByUserIdAndBlogId(@Param("userId") Long userId, @Param("blogId") Long blogId);

    Long countByUserId(@Param("userId") Long userId);

    List<BlogGoods> findAllPage(BlogGoodsPageReq req);

}